<?php
include("../user/userlogincheck.php");
include("../include/config.inc.php");

$consql.="and classify='store' and userid='$userid'";
$sql = "select count(*) as count from ".tableprefix."collection where 1=1 ".$consql;
$row=$db->fetch_array($db->query($sql));
$count=$row["count"];
$page=new ShowPage;
$page->PageSize=20;
$page->Total=$count;
$page->LinkAry = array("id"=>$id);
$sql="select * from ".tableprefix."collection where 1=1 ".$consql." limit ".$page->OffSet();
$result=$db->query($sql);
$showpage= $page->ShowLink();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>关注的店铺 - 订戏会</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=9,Chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="stylesheet" type="text/css" href="../css/public.css">
<link rel="stylesheet" type="text/css" href="../css/user.css">
</head>

<body>
<section class="orders-list">
<?php     
if($count>0){
?>
<?php
while($row = $db->fetch_array($result)){
$store_id=$row['store_id'];
$sql = "select count(*) as count from ".tableprefix."collection where classify='store' and store_id='$store_id'";
$rs=$db->fetch_array($db->query($sql));
$count=$rs["count"];

$sql = "select count(*) as count2 from ".tableprefix."goods where goods_state='1' and store_id='$store_id'";
$rss=$db->fetch_array($db->query($sql));
$count2=$rss["count2"];
?>
	<div class="orders-list-item">
		<div class="orders-main">
			<a href="../store/index.php?id=<?php echo $row['store_id'];?>"><img src="../<?php echo GetValueByKey(tableprefix."store","store_id",$row['store_id'],"store_label");?>" style="width:50px;height:50px;"></a>
			<div class="orders-title">
				<a href="../store/index.php?id=<?php echo $row['store_id'];?>"><h3><?php echo GetValueByKey(tableprefix."store","store_id",$row['store_id'],"store_name");?></h3></a>
				<span>关注：<?php echo $count;?>，演出：<?php echo $count2;?></span>
			</div>
		</div>
	</div>
<?php
}
?>
<?php
}else{
echo "<div style='padding:50px 0px;text-align:center;color:#990000;font-size:12px;'>没有找到合乎条件的记录</div>";
}
?>
</section>

<div id="bottom"></div>

<footer id="bar-fixed">
	<a href="../" class="tab-item"><i class="icon-tabbar bar-home"></i>首页</a>
	<a href="../category.php" class="tab-item"><i class="icon-tabbar bar-message"></i>分类</a>
	<a href="../publish/" class="tab-item"><i class="icon-tabbar bar-publish"></i>发起</a>	
	<a href="../user/" class="tab-item active"><i class="icon-tabbar bar-user2"></i>我</a>
</footer>
</body>
</html>
<?php
$db->free_result($result);
$db->close();
exit;
?>